]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Clear modifiers when the layout is rebuilt
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 10 Sep 2026 12:21:36 +0000 (14:21 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 17:39:10 +0000 (19:39 +0200)
The modifiers and the modifier keys are not cleared when the layout is
rebuilt, and this may cause access to destroyed objects.

So clear them before rebuilding them again when adding the row keys.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9408
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4396>
(cherry picked from commit 7d8323abb81215dc96f716fd66cad42772993685)

js/ui/keyboard.js

index 80f54d1a13ae9fb9b6dcd502ea3c151981f24ca1..da9a1ed9326122c1099ab6d8c76457f1c7ea0a8d 100644 (file)
@@ -1430,6 +1430,8 @@ export const Keyboard = GObject.registerClass({
             purpose === Clutter.InputContentPurpose.ALPHA ||
             purpose === Clutter.InputContentPurpose.PASSWORD ||
             purpose === Clutter.InputContentPurpose.TERMINAL;
+        this._modifiers.clear();
+        this._modifierKeys.clear();
 
         keyboardModel.getLevels().forEach(currentLevel => {
             const levelLayout = new KeyContainer();